#include "testlib.h"
#include <stdio.h>
#include <algorithm>
using namespace std;
#define N 50100
long long x[N], y[N];
int main(int argc, char * argv[])
{
    registerTestlibCmd(argc, argv);
    int n, i, k, j;
	for(n=0; !ans.seekEof(); )
	{
		i=ans.readInt();
		j=ans.readInt();
		x[n++]=(long long)i*N+j;
	}
	for(k=0; !ouf.seekEof(); )
	{
		i=ouf.readInt();
		j=ouf.readInt();
		y[k++]=(long long)i*N+j;
	}
	if(n!=k) quitf(_wa, "wrong number of edges");
	sort(x, x+n);
	sort(y, y+n);
	for(i=1; i<n; i++)
		if(y[i]==y[i-1]) quitf(_pe, "double edge");
	for(i=0; i<n; i++)
		if(x[i]!=y[i]) quitf(_wa, "wrong edge");
	quitf(_ok, "there are %d edges", n);
}